﻿#pragma once

#include "CAmtInfWrapper.h"
#include "CCptInfWrapper.h"
#include "CEParaWrapper.h"
#include "CIdtInfWrapper.h"
class CStdInfManager
{
public:
    CAmtInfWrapper *pAmtInfWrapper; // x0 -> 0
    CCptInfWrapper *pCptInfWrapper; // x1 -> 4
    CEParaWrapper *pEParaWrapper;   // x2 -> 8
    CIdtInfWrapper *pIdtInfWrapper; // x3 -> 12
    int32_t AmtInfNum;              // x4 -> 16
    int32_t CptInfNum;              // x5 -> 20
    int32_t EParaNum;               // x6 -> 24
    int32_t currentAmtIdx;          // x7 -> 28
    double *amtMValue;              // x8 -> 32
    double *amtM2Value;             // x9 -> 36
    int32_t curveType;              // x10 -> 40
    int32_t oneOrZero;              // x11 -> 44
    int32_t segCalibMode;           // x12 -> 48

    CStdInfManager();

    void printSelf(char *captionUpper, int32_t deep);

    // sub_10022FBF
    CStdInfManager *init(CAmtInfWrapper *pAmtInfWrapper, CCptInfWrapper *pCptInfWrapper, CEParaWrapper *pEParaWrapper,
                         CIdtInfWrapper *pIdtInfWrapper, int32_t curveType, int32_t oneOrZero);

    // sub_1002318F
    void clear();

    // sub_1001D580
    void *close(char flag);

    // sub_1001D5B0
    void close();

    // sub_1001AD70
    int32_t isAmtIndexNotZero();

    // sub_100231AE
    int32_t cleanCPTItem();

    // sub_1001ADF0
    int32_t isValidAmpRepIndex();

    // sub_100232DE
    CStdInfManager *eliminateRepNumInCPT(int32_t eIdx);

    // sub_1001AE60
    int32_t reachedLastAmtRepsNum();

    // sub_1002395D
    int32_t calcMethodValueAndWeightAll();

    // sub_100233DD
    CStdInfManager *incCurrentAmtIdx();

    // sub_1001ADB0
    int32_t getcurrentAmtRepIdx();

    // sub_1001AE20
    int32_t getCurrentAmtRepNum();

    // sub_1001AE40
    int32_t getAmtRepNum(int32_t amtIdx);

    // sub_100235BF
    int32_t calcAllCptAreaAndAmtValue(int32_t amtIdx, double *cptAreaOrWeight, double *amtMValue);

    // sub_1002363F
    int32_t setAreaAndWeightFromCPT(int32_t idx, double *cptAreaOrWeight, double *amtMValue, double *arrValue,
                                    double *arrWeight);

    // sub_10023D6D
    double *calcSegCalibGetDbl5(int32_t eIdx, double *arrValue, double *arrWeight, int32_t amtNum);

    // sub_10024F00
    int32_t incCurrentAmtRepIndex();

    // sub_10024F30
    int32_t clearCurrentAmtRepIndex();

    // sub_10023795
    int32_t calcCPTValueAndWeightArray(int32_t eIdx, double *arrValue, double *arrWeight);

    // sub_10023437
    double getCptAreaOrHeight(int32_t amtIdx, int32_t eIdx);

    // sub_100234DB
    double getCptWeight(int32_t amtIdx, int32_t eIdx);

    // sub_10023566
    double getWeightedAmtM2Value(int32_t amtIdx, int32_t eIdx);

    CStdInfManager *addCptAreaAndWeight(int32_t idx, double area, float weight);
};
